import {
  axios
} from '@/utils/request'
/**
         * 事项-我的申请api
      */
// 我的申请列表查询
function getMyApplyList (data) {
  return axios({
    url: '/workflow-manage/instance/own',
    method: 'get',
    params: data
  })
}
// 查询任务审核申请内容详情
function getTaskApplicationDetail (data) {
  return axios({
    url: '/task-service/task/info-workflow',
    method: 'get',
    params: data
  })
}
// 获取任务转交人
function getTaskTransfor (data) {
  return axios({
    url: '/workflow-manage/myaudit/transfer-users/'+ data,
    method: 'get'
  })
}
// 审批转交接口
function auditTransfor (data) {
  return axios({
    url: '/workflow-manage/myaudit/transfer',
    method: 'put',
    data
  })
}
// 查询追加车辆审核申请内容详情
function getAddCarApplicationDetail (data) {
  return axios({
    url: '/task-service/task/addcar-info-workflow',
    method: 'get',
    params: data
  })
}

// 查询策略审核申请内容详情
function getStrategyApplicationDetail (data) {
  return axios({
    url: '/task-service/strategy/info-workflow',
    method: 'get',
    params: data
  })
}
// 查询服务审核申请内容详情-1
function getServiceApplicationDetail1 (data) {
  return axios({
    url: '/service-sale/serviceModel/auditing/list',
    method: 'get',
    params: data
  })
}
// 查询服务审核申请内容详情-2
function getServiceApplicationDetail2 (data) {
  return axios({
    url: '/vehicle-service/model/audit/info',
    method: 'get',
    params: data
  })
}
// 查询服务审核申请内容详情-工程院
function getTaskApplicationGcyAuditDetail (data) {
  return axios({
    url: '/task-service/task/getTaskApplicationGcyAuditDetail',
    method: 'get',
    params: data
  })
}
// 催办我的申请
function urgeMyApply (data) {
  return axios({
    url: '/workflow-manage/instance/urge',
    method: 'put',
    data
  })
}
// 撤回我的申请
function cancelMyApply (data) {
  return axios({
    url: '/workflow-manage/instance/cancel',
    method: 'put',
    data
  })
}
// 获取草稿列表
function getDraftList (data) {
  return axios({
    url: '/workflow-manage/draft/page',
    method: 'get',
    params: data
  })
}
// 查询草稿详情
function getDraftDetail (data) {
  return axios({
    url: '/workflow-manage/draft/' + data,
    method: 'get'
  })
}
// 编辑草稿详情
function editMyDraftApply (data) {
  return axios({
    url: '/workflow-manage/draft',
    method: 'put',
    data
  })
}
// 删除草稿详情
function deleteMyDraftApply (ids) {
  return axios({
    url: '/workflow-manage/draft',
    method: 'delete',
    data: {
      ids
    }
  })
}


// 查询任务审核申请内容详情
function getTaskApplicationDetailGcy (data) {
  return axios({
    url: '/task-service/task/info-workflow-gcy',
    method: 'get',
    params: data
  })
}

// OTA工程师审批-通道测试
function uploadOTAReviewDetail (data) {
  return axios({
    url: '/task-service/task/audit/channel',
    method: 'post',
    data
  })
}

// 测试工程师审批-功能测试
function uploadTestReviewDetail (data) {
  return axios({
    url: '/task-service/task/audit/function',
    method: 'post',
    data
  })
}

// 品质工程师审批-设置VIN、预约升级时间
function uploadQualityReviewDetail (data) {
  return axios({
    url: '/task-service/task/audit/quality',
    method: 'post',
    data
  })
}

// 查询通用审核申请内容详情
function getCommonApplyDetail (data) {
  return axios({
    url: '/task-service/applyform/detail?instanceId='+data,
    method: 'get'
  })
}

export default {
  getMyApplyList,
  urgeMyApply,
  cancelMyApply,
  getDraftList,
  getDraftDetail,
  deleteMyDraftApply,
  editMyDraftApply,
  getTaskApplicationDetail,
  getTaskTransfor,
  auditTransfor,
  getStrategyApplicationDetail,
  getServiceApplicationDetail1,
  getServiceApplicationDetail2,
  getTaskApplicationGcyAuditDetail,
  getTaskApplicationDetailGcy,
  getAddCarApplicationDetail,
  uploadOTAReviewDetail,
  uploadTestReviewDetail,
  uploadQualityReviewDetail,
  getCommonApplyDetail
}
